#!/usr/bin/perl -w

my $group=shift;
my $uid=shift;

while(<STDIN>){
        chomp;
        my $user=$_;
        print("
dn: cn=$user,ou=group,ou=$group,dc=nothing,dc=cn
cn: $user
gidNumber: $uid
objectClass: posixGroup
 
dn: uid=$user,ou=user,ou=$group,dc=nothing,dc=cn
uid: $user
cn: $user
sn: $user
mail: $user\@nothing.cn
accountStatus: active
mailMessageStore: /var/mail/$user/
uidNumber: $uid
gidNumber: $uid
homeDirectory: /home/lusers/$user
userpassword: $user
loginShell: /bin/bash
objectClass: organizationalPerson
objectclass: person
objectclass: inetOrgPerson
objectClass: posixAccount
objectclass: qmailUser
objectClass: top

");

        $uid=$uid+1;
} 
exit;

